package com.edgar.redis;

import org.junit.Assert;
import redis.clients.jedis.Jedis;

import java.util.logging.Logger;

/**
 * @author liqs
 * @version 1.0
 * @date 2021/6/9 16:38
 * 文档 http://redis.cn/commands.html#
 */
public class RedisClient {

    private Logger logger = Logger.getLogger(RedisClient.class.toString());
    private Jedis jedis;

    public RedisClient(String host, int port) {
        jedis = new Jedis(host, port);
        if (!jedis.ping().equals("PONG")) {
            logger.info("can not connect redis, host:" + host + "port:" + port);
        }
    }

    public Jedis getJedis() {
        return jedis;
    }

}
